package com.hsc.yalebao.adapter;

import android.content.Context;
import android.content.res.Resources;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.hsc.yalebao.model.ReturnwaterResultBaseBean;
import com.hsc.yalebao.tools.UiUtil;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;

public class ReturnwaterListAdapter extends BaseAdapter
{
  String TAG = "ReturnwaterListAdapter";
  int colorGreen = -1;
  int colorRed = 0;
  private Context context;
  int count = 1;
  ViewHolder holder = null;
  private LayoutInflater inflater;
  private ArrayList<ReturnwaterResultBaseBean> list;
  HashMap<Integer, View> mapView = new HashMap();
  private Resources resources = null;

  public ReturnwaterListAdapter(Context paramContext, ArrayList<ReturnwaterResultBaseBean> paramArrayList)
  {
    this.context = paramContext;
    this.inflater = LayoutInflater.from(paramContext);
    this.list = paramArrayList;
    this.resources = paramContext.getResources();
    this.colorGreen = this.resources.getColor(2131165336);
    this.colorRed = this.resources.getColor(2131165214);
  }

  public int getCount()
  {
    if (this.list == null)
      return 0;
    return this.list.size();
  }

  public Object getItem(int paramInt)
  {
    return this.list.get(paramInt);
  }

  public long getItemId(int paramInt)
  {
    return paramInt;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    if (paramView == null)
    {
      this.holder = new ViewHolder();
      paramView = this.inflater.inflate(2130903171, null);
      this.holder.tv_time = ((TextView)paramView.findViewById(2131099850));
      this.holder.tv_num = ((TextView)paramView.findViewById(2131100132));
      this.holder.tv_num1 = ((TextView)paramView.findViewById(2131100133));
      this.holder.tv_statu = ((TextView)paramView.findViewById(2131100134));
      ViewHolder localViewHolder = this.holder;
      paramView.setTag(localViewHolder);
    }
    ReturnwaterResultBaseBean localReturnwaterResultBaseBean;
    while (true)
    {
      localReturnwaterResultBaseBean = (ReturnwaterResultBaseBean)this.list.get(paramInt);
      if (localReturnwaterResultBaseBean != null)
        break;
      return paramView;
      this.holder = ((ViewHolder)paramView.getTag());
    }
    this.holder.tv_time.setText(localReturnwaterResultBaseBean.getDays());
    double d1 = 0.0D;
    try
    {
      d1 = Double.parseDouble(localReturnwaterResultBaseBean.getRate());
      if (d1 == 0.0D)
        this.holder.tv_num1.setText("回水0%");
    }
    catch (NumberFormatException localNumberFormatException1)
    {
      try
      {
        double d2 = Double.parseDouble(localReturnwaterResultBaseBean.getLossmoney());
        if (d2 * d1 == 0.0D)
          this.holder.tv_num.setText("0.00元");
        while (true)
        {
          try
          {
            if (Double.parseDouble(localReturnwaterResultBaseBean.getRate()) <= 0.0D)
              break label402;
            this.holder.tv_statu.setText("满足");
            this.holder.tv_statu.setTextColor(this.colorRed);
            return paramView;
          }
          catch (NumberFormatException localNumberFormatException3)
          {
            localNumberFormatException3.printStackTrace();
            return paramView;
          }
          double d4 = d1 * 100.0D;
          int i = Integer.parseInt(new DecimalFormat("0").format(d4));
          this.holder.tv_num1.setText("回水" + i + "%");
          break;
          localNumberFormatException1 = localNumberFormatException1;
          localNumberFormatException1.printStackTrace();
          break;
          double d3 = d2 * d1;
          String str = UiUtil.savePoint(Double.valueOf(d3).doubleValue(), 2);
          this.holder.tv_num.setText(str + "元");
        }
      }
      catch (NumberFormatException localNumberFormatException2)
      {
        while (true)
          localNumberFormatException2.printStackTrace();
        label402: this.holder.tv_statu.setText("未满足");
        this.holder.tv_statu.setTextColor(this.context.getResources().getColor(2131165335));
      }
    }
    return paramView;
  }

  public void setData(ArrayList<ReturnwaterResultBaseBean> paramArrayList)
  {
    this.list = paramArrayList;
  }

  public class ViewHolder
  {
    private TextView tv_num;
    private TextView tv_num1;
    private TextView tv_statu;
    public TextView tv_time;

    public ViewHolder()
    {
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.adapter.ReturnwaterListAdapter
 * JD-Core Version:    0.6.2
 */